import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);
const user: object = {
  namespaced: true,
  state: {
    token: null,
  },
  mutations: {
    setToken(state: object, usertoken: string) {
      state = {
        ...state,
        token: usertoken,
      };
    },
  },
  actions: {

  },
  getters: {

  },
};

export default new Vuex.Store({
  modules: {
    user,
  },
});

// export default new Vuex.Store({
//   state: {
//     token: null,
//   },
//   mutations: {
//     setToken(state, token) {
//       state.token = token;
//     },
//   },
//   actions: {

//   },
// });
